package cn.bdqn.dao;

import java.util.Date;
import java.util.List;

import cn.bdqn.dao.impl.NewsDaoImpl;
import cn.bdqn.pojo.News;

public class TestNewsDao {
	public static void main(String[] args) {
		NewsDao newsDao = new NewsDaoImpl();
		News news = new News();
		news.setId(3);
		news.setCategoryId(1);
		news.setTitle("测试数据1116标题");
		news.setAuthor("admin");
		news.setContent("测试数据1116");
		news.setSummary("测试数据1116摘要");
		news.setCreateDate(new Date());
		newsDao.add(news);
//		newsDao.update(news);
//		newsDao.delete(news);
		List<News> newsList = newsDao.getNewsList();
		for(News _news:newsList){
			System.out.println("id: " + _news.getId() + "\t title: " + _news.getTitle() + "\t categoryName: " + _news.getCategoryName());
		}
	}
}
